﻿using Castle.Windsor;
using GroceryList.Front.Web.Installers;
using GroceryList.Front.Web.Service;
using Xunit;

namespace GroceryList.Test
{
    public class ServiceInstallerTest
    {
        private readonly IWindsorContainer _container;

        public ServiceInstallerTest()
        {
            _container =
                new WindsorContainer().
                    Install(new PersistenceInstaller()).
                    Install(new RepositoryInstaller()).
                    Install(new AutomapperInstaller()).
                    Install(new ServiceInstaller());
        }

        [Fact]
        public void CanCreateServicesByUsingServiceInstaller()
        {
            var productoService = _container.Resolve<IProductoService>();
            Assert.NotNull(productoService);
            var listaCompraService = _container.Resolve<IListaCompraService>();
            Assert.NotNull(listaCompraService);
        }
    }
}
